package com.example.springbootjenkinsdockerdemo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@RestController
public class TestController {

    @PersistenceContext
    private EntityManager entityManager;

    @RequestMapping(value = "/test")
    public String test() {
        return "哇哇哇哇哈哈哈";
    }

    @RequestMapping(value = "/testmysql")
    public String testmysql() {
        Docker docker = entityManager.find(Docker.class, "1");
        return docker.getB();
    }
}
